package com.hopu.oa.service.impl.notemanage;


import com.hopu.oa.dao.notemanage.NoteDao;
import com.hopu.oa.dao.notemanage.NoteListDao;
import com.hopu.oa.entity.management.AoaStatusList;
import com.hopu.oa.entity.management.AoaTypeList;

import com.hopu.oa.entity.notemanage.AoaCatalog;
import com.hopu.oa.entity.notemanage.AoaNoteList;
import com.hopu.oa.entity.notemanage.AoaReceiverNote;
import com.hopu.oa.entity.plan.AttachmentList;
import com.hopu.oa.entity.user.AoaDept;
import com.hopu.oa.entity.user.AoaPosition;
import com.hopu.oa.entity.user.AoaUser;

import com.hopu.oa.service.notemanage.NoteService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class NoteServiceImpl implements NoteService {

    @Autowired
    private NoteDao noteDao;
    @Autowired
    private NoteListDao noteListDao;


    @Override
    public List<AoaCatalog> selectByUserId(Integer userId) {
        return noteDao.selectByUserId(userId);
    }

    @Override
    public List<AoaTypeList> selectByTypeModel(String typeModel) {
        return noteDao.selectByTypeModel(typeModel);
    }

    @Override
    public List<AoaStatusList> selectByStatusModel(String statusModel) {
        return noteDao.selectByStatusModel(statusModel);
    }

    @Override
    public List<AoaNoteList> selectAllAndPage(Integer userId, String baseKey, Integer index, Integer size) {
        return noteListDao.selectAllAndPage(userId, baseKey, index, size);
    }

    @Override
    public AoaNoteList selectByPrimaryKey(Integer noteId) {
        return noteListDao.selectByPrimaryKey(noteId);
    }

    /**
     * 查找附件
     *
     * @param id
     * @return
     */
    @Override
    public AttachmentList selectByAttachmentId(Integer id) {
        return noteListDao.selectByAttachmentId(id);
    }

    @Override
    public List<AoaUser> selectByAndPage(String baseKey, Integer index, Integer size) {
        return noteDao.selectByAndPage(baseKey, index, size);
    }

    @Override
    public List<AoaDept> selectByAllDept() {
        return noteDao.selectByAllDept();
    }

    @Override
    public List<AoaPosition> selectByAllPosition() {
        return noteDao.selectByAllPosition();
    }

    @Override
    public AoaCatalog selectByCatalogName(String name, Integer userId) {
        return noteDao.selectByCatalogName(name, userId);
    }

    @Override
    public AoaTypeList selectByTypeName(String name) {
        return noteDao.selectByTypeName(name);
    }

    @Override
    public AoaStatusList selectByStatusName(String name) {
        return noteDao.selectByStatusName(name);
    }

    @Override
    public int insertSelective(AoaNoteList record) {
        return noteListDao.insertSelective(record);
    }

    @Override
    public AoaUser selectByUserName(String name) {
        return noteDao.selectByUserName(name);
    }

    @Override
    public int insert(AoaReceiverNote aoaReceiverNote) {
        return noteDao.insert(aoaReceiverNote);
    }


}
